/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package es.usj.dssie.videoclub.dto;

import java.io.Serializable;
import java.util.Date;

/**
 *
 * @author Nacho
 */
public class Movie implements Serializable {

    private int id;
    private String name;
    private String genre;
    private Date releaseDate;
    private int units;

    public Movie(){}

    public Movie(int id, String name, String genre, Date releaseDate){
        this.id=id;
        this.name=name;
        this.genre = genre;
        this.releaseDate = releaseDate;
    }

    public String getGenre() {
        return genre;
    }

    public void setGenre(String genre) {
        this.genre = genre;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Date getReleaseDate() {
        return releaseDate;
    }

    public void setReleaseDate(Date releaseDate) {
        this.releaseDate = releaseDate;
    }

    public int getUnits() {
        return units;
    }

    public void setUnits(int units) {
        this.units = units;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Movie other = (Movie) obj;
        if (this.id != other.id) {
            return false;
        }
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        if (this.releaseDate != other.releaseDate && (this.releaseDate == null || !this.releaseDate.equals(other.releaseDate))) {
            return false;
        }
        if (this.units != other.units) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 17 * hash + this.id;
        hash = 17 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 17 * hash + (this.genre != null ? this.genre.hashCode() : 0);
        hash = 17 * hash + (this.releaseDate != null ? this.releaseDate.hashCode() : 0);
        hash = 17 * hash + this.units;
        return hash;
    }
}